<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>客车查询系统</title>
    <style>
        .aa {
            color: #1072be;
            font-size: 80px;
        }

        .bb {
            color: #4c95ce;
        }
        .btn {
            padding-top: 30px;
            padding-bottom: 30px;
            padding-left: 120px;
            padding-right: 120px
        }

        /*style="margin:0 auto;text-align: center"*/
    </style>
</head>
<body>
<div style="display: flex;flex-direction:column;justify-content: space-around;align-items:center">
    <span class="aa" style="margin-top: 100px">宇通客车</span><br/>
    <span class="aa">车联网设备查询系统</span><br/>
    <div style="display: flex;flex-direction:column;align-items: flex-start">
        <span class="bb" style="margin-top: 100px;display:flex;align-items: flex-start;font-size: 60px">请输入Vin码</span>
        <input id="et_vin" type="text" id="vin" style="border: 1px solid cornflowerblue;width: 600px;height: 60px;font-size: 40px"><br/>
        <div id="content" style="height: 270px;font-size: 60px;margin-top: 30px">
        </div>
    </div>
    <div style="display:flex;flex-direction:row;flex-grow:1;">
        <span type="reset" class="btn" style="background-color:#f37934;color: white;font-size:40px" id="btn_cancel">取消</span>
        <span type="submit" class="btn" style="background-color:dodgerblue;color: white;margin-left: 10px;font-size: 40px" id="btn_search">查询</span>
    </div>

</div>
<script type="text/javascript" src="jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="md5.min.js"></script>
<script type="text/javascript">
    $(function(){
        var timestamp=new Date().getTime();
        console.log("timestamp",timestamp);
        var channel="WYKJ";
        var key="yutongkey"
        var signa=md5(encodeURI(channel+channel+timestamp+key).toUpperCase());
        console.log("signa",signa);
        $.ajax({
            url: "http://wx.yutong.com/thtml/yutong/live800/getToken.thtml",
            type: 'GET',
            async: false,
            data: {channelType:channel,serviceAccount:channel,timestamp:timestamp,signature:signa},
            success: function (data) {
                console.log("data", data)
            },
            error: function (xhr) {
                console.log("error")
            }
        });
    });
$("#btn_cancel").click(function () {
    $("#et_vin").val("")
    $("#content").text("");
});
$("#btn_search").click(function(){
    $("#content").text("正在查询....");
    var vin=$("#et_vin").val()
    $.ajax({
        url: "https://eat.vehicleplus.net/voss/ent/getEntLoginInfo?token=PCDoWJMPwloLBrsoGrt&vin="+vin,
        type: 'GET',
        async: true,
        success: function (data) {
            console.log("data", data)
            $("#content").html("客户名:"+data.data.entName+"<br />"+"密码:"+data.data.password);
        },
        error: function (xhr) {
            console.log("error")
            $("#content").text("错误");
        }
    });
})

</script>
</body>
</html>